package step

import (
	_interface "adam2/internal/quant/interface"
)

// 买入步骤
type BuyStep struct {
	buy     *_interface.Buy
	buyDate *_interface.BuyDate
}

// 初始化
func (b *BuyStep) Init(buy *_interface.Buy, buyDate *_interface.BuyDate) {
	b.buy = buy
	b.buyDate = buyDate
}

// 执行
func (b *BuyStep) Exec(transactionDate string) {
	if (*b.buyDate).IsBuyDate(transactionDate) {
		(*b.buy).DoBuy(transactionDate)
	}
}
